// #ifndef VUE3
import Vue from 'vue'
import App from './App'
import store from '@/store/store.js'
import uView from '@/uni_modules/uview-ui';
Vue.use(uView);


Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
	...App,	
	store
});


require('@/config/request.js')(app)


uni.$showMsg = function(title = "数据请求失败！", duration = 1500) {
	uni.showToast({
		title,
		duration,
		icon: 'none'
	})
}


const responseInterceptor = (response) => {
  // 响应之后的拦截器
  if (response.statusCode === 401) {
    // 处理401状态码，例如重新登录
    console.log('请求失败，状态码为401');
  }
  return response;
}


app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
import App from './App.vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif